<template>
  <div class="p10">
    <h2>examineItems 检查部位选择</h2>
    <div class="mt10">
      <f-examine-items ref="examineRef" showBedEcecute :examineIds="examineIds" :odItemId="odItemId" />
    </div>
    <div class="mt50 pt10 bt">
      <f-button type="primary" @click="getDatas()">获取选择数据</f-button>
      <f-button class="ml10" type="primary" @click="openExamineItems()">弹窗模式</f-button>
      <f-button class="ml10" type="primary" @click="openFollow">跟随框模式</f-button>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { useExamineItems } from '../../packages';
const examineRef = ref();
// const odItemId = ref('100912');
const odItemId = ref('1804077886121754624');
const examineIds = ref({
  bodyPartsIds: [
    { bodyPartsId: '1747084049189212160', postureId: '1744968532676575232', name: '颈部-俯卧位' },
    { bodyPartsId: '1747084083112742912', postureId: '1744968201892790272', name: '颈胸交界-头低斜坡位' },
    { bodyPartsId: '1747084122014912512', postureId: '1744968154492960768', name: '甲状腺-水平仰卧位' }
  ],
  methodIds: ['1825349529284427780'],
  behindMethodIds: ['1732681624533704704']

  // bodyPartsIds: [],
  // methodIds: [],
  // behindMethodIds: []
});
const getDatas = () => {
  const result = examineRef.value.getChoiceData();
  console.log(result);
};

const { open } = useExamineItems({ type: 'modal' });
const openExamineItems = () => {
  open({
    odItemId: odItemId.value,
    // examineIds: examineIds.value,
    height: 300,
    showBedEcecute: true
  }).then((res) => {
    console.log('@@@@@@@@=>', res);
  });
};

const openFollow = (then) => {
  console.log('then', then);
  open({
    type: 'follow',
    dom: then.target,
    odItemId: odItemId.value,
    examineIds: examineIds.value
  });
};
</script>

<style lang="scss"></style>
